package org.xlx.xlx_oa.reimburse.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.xlx.xlx_oa.common.ResponseBean;
import org.xlx.xlx_oa.reimburse.api.ReimburseImageApi;
import org.xlx.xlx_oa.reimburse.service.ReimburseImageService;

@RestController
@RequestMapping("/v1/reimburse-image")
public class ReimburseImageController implements ReimburseImageApi {
    @Autowired
    private ReimburseImageService imageService;

    @PostMapping("/saveImage")
    @Override
    public ResponseBean saveImage(@RequestParam(value = "fileUrl") String fileUrl){
        Long id = imageService.uploadImage(fileUrl);
        return ResponseBean.successFactory(id);
    }
}

